<html>
<head>
    <meta charset="utf-8" />
</head>
<body>

<style>
    #body {
        width:100%;
        word-break: break-all;
        white-space: break-spaces;
        line-height:25px;
    }
    
    .hi {
        background: #ffb300;
        font-weight: bold;
    }
</style>

<input type="text" placeholder="输入进行搜索" id="word" oninput="search_antishake()"/>
<label><input type="checkbox" value="all" checked id="checkall"/>匹配全部</label>
<label><input type="checkbox" value="sensitive" id="checksensitive" />大小写敏感</label>

<pre id="body">

</pre>
<script type="text/javascript" src="JKSearcher.js"></script>
<script>
    var dataSet = JKSearcher.createDataSet([
        {label:'你好吗123', value:'111'},
        {label:'输入进行搜索', value:'222'},
        {label:'ooii', value:'333'},
        {label:'你好12你好你好3', value:'444'},
        {label:'你好jk123', value:'555'},
        {label:'你好吗123', value:'666'},
    ], {
        // valueKey: 'label',
    });

    var dataSet = JKSearcher.createDataSet([
        "{label:'你好吗123', value:'111'},",
        "{label:'输入进行搜索', value:'222'}",
        "{label:'ooii', value:'333'}",
        "{label:'你好12你好你好3', value:'444'}",
        "{label:'你好jk123', value:'555'}",
        "{label:'你好吗123', value:'666'}",
    ], {
        // valueKey: 'label',
    });

    console.log(
        dataSet.search('nhnh', {highlight: true, all: true})
    );

    dataSet.updateData([
        {label:'你好吗123', value:'111'},
        {label:'输入进行搜索', value:'222'},
        {label:'ooii', value:'333'},
        {label:'我靠你好jk123', value:'555'},
    ]);

    console.log(
        dataSet.search('nihao', {highlight: true, all: true})
    );


    var dataSet2 = JKSearcher.createDataSet({
        a: {title:'你好啊', label: 'asd', test:1},
        b: {title:'输入进行搜索', label: '奖励选择', test:2},
        c: {title:'你好12你好你好3', label: '丰厚奖励', test:3},
    }, {
        // valueKey: 'label',
    });

    console.log(
        dataSet2.search('a', {highlight: true, all: true, sensitive:true})
    );

    
</script>
</body>
</html>
